<template>
  <a-modal
    :title="$t('详情')"
    :width="width"
    :visible="visible"
    @cancel="handleCancel"
    class="customHeight customHeightChild modal_title"
    v-drag
  >
    <template slot="footer">
      <a-button @click="handleCancel">{{$t('取消')}}</a-button>
    </template>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="false"
        :loading="loading"
        class="j-table-force-nowrap"
      >
      </a-table>
    </div>
  </a-modal>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
  name: 'CouponDetailModal',
  data() {
    return {
      width: 700,
      visible: false,
      loading: false,
      dataSource:[],
      columns:[
        {
          title:this.$t('券号'),
          align:'center',
          dataIndex:'id',
          width:'300px'
        },
        {
          title:this.$t('券名称'),
          align:'center',
          dataIndex:'name'
        },
      ],
    }
  },
  methods: {
    edit(record) {
      this.visible = true
      this.dataSource = []
      getAction('/member/bisManualCouponRecord/queryDetailById',{id:record.id}).then(res=>{
        if(res.success){
          this.dataSource = res.result.coupons
        }
      })
    },
    handleCancel() {
      this.visible = false
    },
  },
}
</script>